#  IP Messenger Communication Protocol version 1.2 define 

#basic functions 
def GET_MODE(command): return command & 0x000000ffL
def GET_OPT(command):  return command & 0xffffff00L

#  header
IPMSG_VERSION			= 0x0001
IPMSG_DEFAULT_PORT		= 0x0979

#  command  
IPMSG_NOOPERATION		= 0x00000000L

IPMSG_BR_ENTRY			= 0x00000001L
IPMSG_BR_EXIT			= 0x00000002L
IPMSG_ANSENTRY			= 0x00000003L
IPMSG_BR_ABSENCE		= 0x00000004L

IPMSG_BR_ISGETLIST		= 0x00000010L
IPMSG_OKGETLIST			= 0x00000011L
IPMSG_GETLIST			= 0x00000012L
IPMSG_ANSLIST			= 0x00000013L
IPMSG_BR_ISGETLIST2		= 0x00000018L

IPMSG_SENDMSG			= 0x00000020L
IPMSG_RECVMSG			= 0x00000021L
IPMSG_READMSG			= 0x00000030L
IPMSG_DELMSG			= 0x00000031L
IPMSG_ANSREADMSG		= 0x00000032L

IPMSG_GETINFO			= 0x00000040L
IPMSG_SENDINFO			= 0x00000041L

IPMSG_GETABSENCEINFO            = 0x00000050L
IPMSG_SENDABSENCEINFO           = 0x00000051L

IPMSG_GETFILEDATA		= 0x00000060L
IPMSG_RELEASEFILES		= 0x00000061L
IPMSG_GETDIRFILES		= 0x00000062L

IPMSG_GETPUBKEY			= 0x00000072L
IPMSG_ANSPUBKEY			= 0x00000073L

#  option for all command
IPMSG_ABSENCEOPT		= 0x00000100L
IPMSG_SERVEROPT			= 0x00000200L
IPMSG_DIALUPOPT			= 0x00010000L
IPMSG_FILEATTACHOPT		= 0x00200000L
IPMSG_ENCRYPTOPT		= 0x00400000L

#  option for send command  
IPMSG_SENDCHECKOPT		= 0x00000100L
IPMSG_SECRETOPT			= 0x00000200L
IPMSG_BROADCASTOPT		= 0x00000400L
IPMSG_MULTICASTOPT		= 0x00000800L
IPMSG_NOPOPUPOPT		= 0x00001000L
IPMSG_AUTORETOPT		= 0x00002000L
IPMSG_RETRYOPT			= 0x00004000L
IPMSG_PASSWORDOPT		= 0x00008000L
IPMSG_NOLOGOPT			= 0x00020000L
IPMSG_NEWMUTIOPT		= 0x00040000L
IPMSG_NOADDLISTOPT		= 0x00080000L
IPMSG_READCHECKOPT		= 0x00100000L
IPMSG_SECRETEXOPT		= IPMSG_READCHECKOPT|IPMSG_SECRETOPT

# encryption flags for encrypt command
IPMSG_RSA_512			= 0x00000001L
IPMSG_RSA_1024			= 0x00000002L
IPMSG_RSA_2048			= 0x00000004L
IPMSG_RC2_40			= 0x00001000L
IPMSG_RC2_128			= 0x00004000L
IPMSG_RC2_256			= 0x00008000L
IPMSG_BLOWFISH_128		= 0x00020000L
IPMSG_BLOWFISH_256		= 0x00040000L
IPMSG_SIGN_MD5			= 0x10000000L

# compatibilty for Win beta version 
IPMSG_RC2_40OLD			= 0x00000010L	# for beta1-4 only
IPMSG_RC2_128OLD		= 0x00000040L	# for beta1-4 only
IPMSG_BLOWFISH_128OLD           = 0x00000400L	# for beta1-4 only
IPMSG_RC2_40ALL			= IPMSG_RC2_40|IPMSG_RC2_40OLD
IPMSG_RC2_128ALL		= IPMSG_RC2_128|IPMSG_RC2_128OLD
IPMSG_BLOWFISH_128ALL           = IPMSG_BLOWFISH_128|IPMSG_BLOWFISH_128OLD

# file types for fileattach command
IPMSG_FILE_REGULAR		= 0x00000001L
IPMSG_FILE_DIR			= 0x00000002L
IPMSG_FILE_RETPARENT            = 0x00000003L   # return parent directory
IPMSG_FILE_SYMLINK		= 0x00000004L
IPMSG_FILE_CDEV			= 0x00000005L	# for UNIX
IPMSG_FILE_BDEV			= 0x00000006L	# for UNIX
IPMSG_FILE_FIFO			= 0x00000007L	# for UNIX
IPMSG_FILE_RESFORK		= 0x00000010L	# for Mac

# file attribute options for fileattach command 
IPMSG_FILE_RONLYOPT		= 0x00000100L
IPMSG_FILE_HIDDENOPT            = 0x00001000L
IPMSG_FILE_EXHIDDENOPT          = 0x00002000L	# for MacOS X
IPMSG_FILE_ARCHIVEOPT           = 0x00004000L
IPMSG_FILE_SYSTEMOPT            = 0x00008000L

# extend attribute types for fileattach command
IPMSG_FILE_UID			= 0x00000001L
IPMSG_FILE_USERNAME		= 0x00000002L	# uid by string
IPMSG_FILE_GID			= 0x00000003L
IPMSG_FILE_GROUPNAME            = 0x00000004L	# gid by string
IPMSG_FILE_PERM			= 0x00000010L	# for UNIX
IPMSG_FILE_MAJORNO		= 0x00000011L	# for UNIX devfile
IPMSG_FILE_MINORNO		= 0x00000012L	# for UNIX devfile
IPMSG_FILE_CTIME		= 0x00000013L	# for UNIX
IPMSG_FILE_MTIME		= 0x00000014L
IPMSG_FILE_ATIME		= 0x00000015L
IPMSG_FILE_CREATETIME           = 0x00000016L
IPMSG_FILE_CREATOR		= 0x00000020L	# for Mac
IPMSG_FILE_FILETYPE		= 0x00000021L	# for Mac
IPMSG_FILE_FINDERINFO           = 0x00000022L	# for Mac
IPMSG_FILE_ACL			= 0x00000030L
IPMSG_FILE_ALIASFNAME           = 0x00000040L	# alias fname
IPMSG_FILE_UNICODEFNAME         = 0x00000041L	# UNICODE fname

FILELIST_SEPARATOR	    = '\a'
HOSTLIST_SEPARATOR	    = '\a'
HOSTLIST_DUMMY		    = "\b"

#  end of IP Messenger Communication Protocol version 1.2 define  
